/*
    ajax response拦截，对非法请求回来的状态进行判断
 */


const authority = {
  /*
  * (1): 根据err_code 判断是否有权限请求该接口
  * */
  hasRight: (res = {}, vueObj) => {
      let body = res.body;
      if(body && $.isNumeric(body.error_code)) {
          body.error_code === 1 && ( window['vueObj'] && window['vueObj'].$router.push({name: 'no_right'}) )
      }
  }
};


export default authority;
